package No1_100.No21_30.RemoveDuplicatesfromSortedArray_26;

public class Solution {
    public static int removeDuplicates(int[] nums) {
        int ret = 1;
        int j = 0;
        for (int i = 1; i < nums.length; i++) {
			if (nums[j] == nums[i]) {
				
			}
			else {
				ret++;
				nums[ret-1] = nums[i];
				System.out.println(nums[ret-1]);
				j = i;
			}
		}
        
        return ret;
    }
    public static void main(String[] args) {
    	int[] num = {1,1,2};
    	System.out.println(removeDuplicates(num));
	}
}